package com.lianzhihui.romeex.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lianzhihui.romeex.MyApplication;
import com.lianzhihui.romeex.R;
import com.lianzhihui.romeex.bean.InvitationInfoBean;

import java.util.List;

/**
 * Description: 主页适配器
 * Author: RAMON
 * CreateDate: 2020/11/4 8:10 PM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class InvitationAdapter extends BaseQuickAdapter<InvitationInfoBean.ListBean, BaseViewHolder> {

    public InvitationAdapter(@Nullable List<InvitationInfoBean.ListBean> data) {
        super(R.layout.item_invitation_layout, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, InvitationInfoBean.ListBean item) {
        if (item.getKeyInfo().equals(MyApplication.mContext.getResources().getString(R.string.text_dir_people))) {
            helper.getView(R.id.item_layout).setBackgroundColor(MyApplication.mContext.getResources().getColor(R.color.text_invitation_bg_color));
        }
        helper.setText(R.id.key_info, item.getKeyInfo())
                .setText(R.id.key_value, item.getKeyValue());

    }
}
